function insertSolution {
  a=`ls | grep "[.]wcnf$"`

  for i in $a; do 
    sol=`cat "${i}.sol.sat_brute"`
    cat $i | sed "10i\
    $sol
    " > tmp
    cat tmp > $i
  done

  rm tmp
}

function insertWeights {
  variables=250
  a=`ls | grep "[.]cnf$"`
  
  for i in $a; do 
    weights="w"
    for (( j=0; j<$variables; j++ )) {
      random=`echo "(($RANDOM % 100) + 1)" | bc`
      weights="$weights $random"
    }
    cat $i | sed "9i\
    $weights
    " > tmp
    cat tmp > $i
  done

  rm tmp
}

function removeSpace {
  variables=250
  a=`ls | grep "[.]cnf$"`
  
  for i in $a; do 
    weights="w"
    for (( j=0; j<$variables; j++ )) {
      random=`echo "(($RANDOM % 100) + 1)" | bc`
      weights="$weights $random"
    }
    cat $i | sed "s/^[ ]//g" > tmp
    cat tmp > $i
  done

  rm tmp
}

insertWeights